<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet"
	href="<%=path %>/res/common/css/bootstrap.min.css">
<script src="res/common/js/bootstrap.min.js"></script>
</head>

<body style="margin: 0px">
<body style="position: relative;">

	<table class="table table-striped">
		<tr>
			<th colspan="7" style="text-align: center;">班级管理</th>
		</tr>
		<tr>
			<td align="left">序号</td>
			<td align="left">班级</td>
			<td align="left">修改班级名</td>
			<td align="left">信息</td>
			<td align="left">删除班级</td>
		</tr>
		<c:forEach var="vo" items="${list}" varStatus="vs">
			<tr>
				<td>${vs.index+1}</td>
				<td><a href="<%=path %>/classinformation/${vo.classId}.do"
					class="sidebar-nav-menu">${vo.className}</a></td>
				<td>
					<form action="classgroupUpdate.do?classid=${vo.classId}"
						method="post">
						<div class="col-sm-4">
							<input class="form-control" name="classname">
						</div>
						<button type="sumbit" class="col-sm-2 btn btn-default">修改</button>
					</form>
				</td>
				<td>${vo.classDescribe}</td>
				<td><a
					href="<%=path %>/classgroupDelete.do?classid=${vo.classId}"
					class="sidebar-nav-menu"> <span class="sidebar-nav-mini-hide">删除</span>
				</a></td>
			</tr>
		</c:forEach>

	</table>
	<%
	String classgroupupdate = (String)request.getAttribute("classgroupupdate"); 
	String classgroupdelete = (String)request.getAttribute("classgroupdelete");
	String classgroupaddup = (String)request.getAttribute("classgroupaddup");
	if (classgroupupdate == "1") {
	%>
	<script type="text/javascript">
        	alert("修改完毕");
		</script>
	<% 
	}
	if (classgroupdelete == "1") {
	%>
	<script type="text/javascript">
	        alert("班级已成功删除");
		</script>
	<% 
	}
	if (classgroupaddup == "1") {
		%>
	<script type="text/javascript">
		        alert("不能为空");
			</script>
	<% 
		}
	else if (classgroupaddup == "2") {
		%>
	<script type="text/javascript">
	        alert("班级创建成功");
		</script>
	<% 
	}
	%>
</body>
</html>
